import request from "@/utils/request";
import type {
  loginFormData,
  loginResponseData,
  userInfoReponseData,
} from "./type";
// import type { loginParams, loginResult, userResult } from "./type";

// enum API {
//   LOGIN_URL = "/user/login",
//   USERINFO_URL = "/user/info",
// }

// // 登录接口
// export const reqLogin = (data: loginParams) =>
//   request.post<any, loginResult>(API.LOGIN_URL, data);

// // 获取用户信息
// export const reqUserInfo = () => request.get<any, userResult>(API.USERINFO_URL);

enum API {
  LOGIN_URL = "/admin/acl/index/login",
  USERINFO_URL = "/admin/acl/index/info",
}

//登录接口
export const reqLogin = (data: loginFormData) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data);
//获取用户信息
export const reqUserInfo = () =>
  request.get<any, userInfoReponseData>(API.USERINFO_URL);
